package com.hl.toolkit.server.tycoin.common.enums;

public enum PaymentStatusEnum {
    loading(0, "待支付"), SUCCESS(1, "支付成功"),FAIL(2,"支付失败"),CANNER(3,"撤销"),CALLBACK(4,"已退款"),ERROR(5,"异常");
//	0：待支付，1：成功，2：失败，3：撤销，4退款，5异常
    int key;
    String value;

    PaymentStatusEnum(int key, String value) {
        this.key = key;
        this.value = value;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static PaymentStatusEnum getEnumByKey(int key) {
        for (PaymentStatusEnum objEnum : PaymentStatusEnum.values()) {
            if (key == objEnum.getKey()) {
                return objEnum;
            }
        }
        return null;
    }
}
